<html>
<head>
<title>管理系统</title>
<meta http-equiv=Content-Type content=text/html;charset=utf-8>
<#include "../inc/commonJs.html">
<script type="text/JavaScript">
	var grid;
	var grid1;
	var grid2;
	var grid3;
	$(function() {
		 //分类管理表格  
 		 grid = $('#mydocgrid').datagrid({
         url:'kqspCheck.do',  
         loadMsg:'数据加载中请稍后……',  
         pagination: true,  
         rownumbers: true,
         pageSize: [${syscfg.pageSize!10}],
         pageList: [${syscfg.pageList!10}],
         striped: true,  
         singleSelect : true,  
         columns:[[  
                   {field:'odatetime',title: '申请时间',align: 'center',width: '150'},  
                   {field:'applicantname',title: '申请人',align: 'center',width: '100'},  
                   {field:'sdatetime',title: '加班开始时间',align: 'center',width: '150'},
                   {field:'edatetime',title: '加班结束时间',align: 'center',width: '150'},
                   {field:'leadername',title: '审批人',align: 'center',width: '150'},
                   {field:'flag',title: '状态',align: 'center',width: '150',
                    	formatter: function(value,rowdata,index){
                    		var str = '';
                    		if(value == '0'){
                    			str = "待审";
                    		}else if(value == '1'){
                    			str = "通过";
                    		}else if(value == '2'){
                    			str = "驳回";
                    		}
       					return str;
       				}
                    },
                    {field:'id',title: '操作',align: 'center',width: '250',
                      	formatter: function(value,rowdata,index){
         					var	str = '<a id="btnadd" class="l-btn l-btn-plain" href="${request.contextPath}/xadmin/rskq/kqjbSpt.do?id='+value+'"><span class="l-btn-left"><span class="l-btn-text icon-ok l-btn-icon-left">通过</span></span></a>';
         					str += '<a id="btnadd" class="l-btn l-btn-plain" href="${request.contextPath}/xadmin/rskq/kqjbSpb.do?id='+value+'"><span class="l-btn-left"><span class="l-btn-text icon-ok l-btn-icon-left">驳回</span></span></a>';
         					return str;
         				}
                      }
              ]],
             toolbar : '#mydocgridtoolbar'
     });
     
     grid1 = $('#orgdocgrid').datagrid({
		 width: 'auto',  
         height:'auto',             
         striped: true,  
         singleSelect : true,  
         url:'kqspQingjia.do',
         loadMsg:'数据加载中请稍后……',  
         pagination: true,  
         rownumbers: true,
         queryParams: {
			zt: '2'
		 },
		 columns:[[  
		             {field:'odatetime',title: '申请时间',align: 'center',width: '150'},  
		             {field:'applicantname',title: '申请人',align: 'center',width: '100'},  
		             {field:'sdatetime',title: '加班开始时间',align: 'center',width: '150'},
		             {field:'edatetime',title: '加班结束时间',align: 'center',width: '150'},
		             {field:'leadername',title: '审批人',align: 'center',width: '150'},
		             {field:'flag',title: '状态',align: 'center',width: '150',
	                    	formatter: function(value,rowdata,index){
	                    		var str = '';
	                    		if(value == '0'){
	                    			str = "待审";
	                    		}else if(value == '1'){
	                    			str = "通过";
	                    		}else if(value == '2'){
	                    			str = "驳回";
	                    		}
	       					return str;
	       				}
	                    },
	                    {field:'id',title: '操作',align: 'center',width: '250',
	                      	formatter: function(value,rowdata,index){
	         					var	str = '<a id="btnadd" class="l-btn l-btn-plain" href="${request.contextPath}/xadmin/rskq/kqqjSpt.do?id='+value+'"><span class="l-btn-left"><span class="l-btn-text icon-ok l-btn-icon-left">通过</span></span></a>';
	         					str += '<a id="btnadd" class="l-btn l-btn-plain" href="${request.contextPath}/xadmin/rskq/kqqjSpb.do?id='+value+'"><span class="l-btn-left"><span class="l-btn-text icon-ok l-btn-icon-left">驳回</span></span></a>';
	         					return str;
	         				}
	                      }
		         ]],
             toolbar : '#orgdocgridtoolbar'
     });  
     
     grid2 = $('#wpgrid').datagrid({
		 width: 'auto',  
         height:'auto',             
         striped: true,  
         singleSelect : true,  
         url:'kqspWaichu.do',
         loadMsg:'数据加载中请稍后……',  
         pagination: true,  
         rownumbers: true,
         queryParams: {
			zt: '2'
		 },
		 columns:[[  
		             {field:'odatetime',title: '申请时间',align: 'center',width: '150'},  
		             {field:'applicantname',title: '申请人',align: 'center',width: '100'},  
		             {field:'sdatetime',title: '加班开始时间',align: 'center',width: '150'},
		             {field:'edatetime',title: '加班结束时间',align: 'center',width: '150'},
		             {field:'leadername',title: '审批人',align: 'center',width: '150'},
		             {field:'flag',title: '状态',align: 'center',width: '150',
	                    	formatter: function(value,rowdata,index){
	                    		var str = '';
	                    		if(value == '0'){
	                    			str = "待审";
	                    		}else if(value == '1'){
	                    			str = "通过";
	                    		}else if(value == '2'){
	                    			str = "驳回";
	                    		}
	       					return str;
	       				}
	                    },
	                    {field:'id',title: '操作',align: 'center',width: '250',
	                      	formatter: function(value,rowdata,index){
	         					var	str = '<a id="btnadd" class="l-btn l-btn-plain" href="${request.contextPath}/xadmin/rskq/kqwcSpt.do?id='+value+'"><span class="l-btn-left"><span class="l-btn-text icon-ok l-btn-icon-left">通过</span></span></a>';
	         					str += '<a id="btnadd" class="l-btn l-btn-plain" href="${request.contextPath}/xadmin/rskq/kqwcSpb.do?id='+value+'"><span class="l-btn-left"><span class="l-btn-text icon-ok l-btn-icon-left">驳回</span></span></a>';
	         					return str;
	         				}
	                      }
		         ]],
             toolbar : '#wpgridtoolbar'
     }); 
   
  })

	
	function restore(gridId){
		$('#'+gridId+'toolbar input').val('');
		$('#'+gridId).datagrid('reload');
	}
	function dosearch(gridId){
		var params =$('#'+gridId).datagrid('options').queryParams;
		if($('#'+gridId+'name').val()){
			params['odatetime'] = $('#'+gridId+'name').val();
		}
		$('#'+gridId).datagrid('reload',params);
	}
</script>
</head>
<body>
<div class="easyui-tabs" data-options="fit:true">
	<div title="加班申请">
		<table id="mydocgrid" data-options="fit:true,border:false"></table>
	</div>
	<div title="请假申请">   
       <table id="orgdocgrid" data-options="fit:true,border:false"></table>
    </div>
    <div title="外出申请">   
       <table id="wpgrid" data-options="fit:true,border:false"></table>
    </div>
</div>   
	<div id="mydocgridtoolbar" style="display: none;">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr >
				<td valign="center">
					&nbsp;&nbsp;申请时间:
					<input  type="text" onClick="calendar.show(this);" id="mydocgridname" name="name" maxlength="30" style="width:150px;">
				</td>
				<td valign="center">	
					<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="dosearch('mydocgrid');">搜索</a>
				</td>
				<td valign="center">
					<div class="datagrid-btn-separator"></div>
				</td>
				<td valign="center">
					<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="restore('mydocgrid');">重置</a>
				</td>
				<td valign="center">
					<div class="datagrid-btn-separator"></div>
				</td>
				<td valign="center">
					<div class="datagrid-btn-separator"></div>
				</td>
			</tr>
		</table>
	</div>
	<div id="orgdocgridtoolbar" style="display: none;">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr >
				<td valign="center">
					&nbsp;&nbsp;申请时间:
					<input  type="text" onClick="calendar.show(this);" id="orgdocgridname" name="name" maxlength="30" style="width:150px;">
				</td>
				<td valign="center">	
					<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="dosearch('orgdocgrid');">搜索</a>
				</td>
				<td valign="center">
					<div class="datagrid-btn-separator"></div>
				</td>
				<td valign="center">
					<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="restore('orgdocgrid');">重置</a>
				</td>
				<td valign="center">
					<div class="datagrid-btn-separator"></div>
				</td>
				<td valign="center">
					<div class="datagrid-btn-separator"></div>
				</td>
			</tr>
		</table>
	</div>
	<div id="wpgridtoolbar" style="display: none;">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr >
				<td valign="center">
					&nbsp;&nbsp;申请时间:
					<input  type="text" onClick="calendar.show(this);" id="wpgridname" name="name" maxlength="30" style="width:150px;">
				</td>
				<td valign="center">	
					<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="dosearch('wpgrid');">搜索</a>
				</td>
				<td valign="center">
					<div class="datagrid-btn-separator"></div>
				</td>
				<td valign="center">
					<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="restore('wpgrid');">重置</a>
				</td>
				<td valign="center">
					<div class="datagrid-btn-separator"></div>
				</td>
				<td valign="center">
					<div class="datagrid-btn-separator"></div>
				</td>
			</tr>
		</table>
	</div>
</body>
</html>